<?php
 /**
 * Version Support
 * 
 * This topic explains the version support feature and how its useful.
 * 
 * @editing     This page is specific to CI Docs documentation, therefor should not be edited
 * @url     /general/version_support
 */
?>

<h1><?php echo $title; ?></h1>

<p>CI Docs allows version support to enable you to have multiple versions of your user guide on one install.</p>

<h2>How does version support work?</h2>

<p>First of all to make things clear, version support <em>does not</em> mean that CI Docs will create versions of your files for you. What it <em>will</em> do is allow for you to have multiple versions of a user guide allowing the user to pick which version they want to be viewing (in case the user is using an older version of your project).</p>

<p>Lets say you have CI Docs installed at <dfn>http://docs.domain.com/</dfn>. If you have <?php echo $this->toc->link('general/multi_guide_support', 'multi guide support'); ?> <strong>OFF</strong> your typical url will look like:<br/>
<dfn>http://docs.domain.com/<var>VERSION</var>/table_of_contents</dfn></p>

<p>With multi guide support <strong>ON</strong> it would be:
<br/><dfn>http://docs.domain.com/<var>USER_GUIDE</var>/<var>VERSION</var>/table_of_contents</dfn>.</p>

<p>The <var>VERSION</var> is something like <var>vX.X.X</var>. E.g. <strong>v1.0</strong>, <strong>v.0.1.1b</strong>, <strong>v2</strong>. The version number <strong>must always</strong> have the <var>v</var> before it or CI Docs will not recognize it as a version. You can have as many versions of a guide as you like. If you omit the version while version support is on, it will get the latest version which is based on what you set in your User Guide config (<dfn>/app/user_guides/<var>USER_GUIDE</var>/config/<var>USER_GUIDE</var>_config.php</dfn>).</p>

<h2>How do I enable version support?</h2>

<p>In your User Guide config (<dfn>/app/user_guides/<var>USER_GUIDE</var>/config/<var>USER_GUIDE</var>_config.php</dfn>) you will modify the <var>version_support</var> item like so:</p>

<code>$config['version_support'] = <kbd>TRUE</kbd>;</code>

<p>By having the config item in your User Guides config you can have version support enabled for one guide, but not for another.</p>

<h2>Adjusting folder structure for Version Support</h2>

<p>When you enable version support you will need to adjust your User Guide directory as well. Inside of your User Guide directory (<dfn>/app/user_guides/<var>USER_GUIDE</var>/</dfn>) each version will have <strong>its own</strong> directory. So if you are converting to version support from an already made user guide, you would take the contents of the folder <dfn>/app/user_guides/<var>USER_GUIDE</var>/</dfn> and put them into a subdirectory with the version: <dfn>/app/user_guides/<var>USER_GUIDE</var>/v1.0/</dfn>. This version number will be the one you use in your url.</p>

<h3>Version URLs With Multi Guide OFF</h3>
<table class="table">
	<thead>
		<tr>
			<th>Without Version URL</th>
			<th>With Version URL</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td><dfn>http://docs.domain.com/table_of_contents</dfn></td>
			<td><dfn>http://docs.domain.com/<var>v1.5</var>/table_of_contents</dfn></td>
		</tr>
		<tr>
			<td><dfn>http://docs.domain.com/info/changelog</dfn></td>
			<td><dfn>http://docs.domain.com/<var>v1.5</var>/info/changelog</dfn></td>
		</tr>
	</tbody>
</table>

<h3>Version URLs With Multi Guide ON</h3>
<table class="table">
	<thead>
		<tr>
			<th>Without Version URL</th>
			<th>With Version URL</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td><dfn>http://docs.domain.com/CI_Docs/table_of_contents</dfn></td>
			<td><dfn>http://docs.domain.com/CI_Docs/<var>v1.5</var>/table_of_contents</dfn></td>
		</tr>
		<tr>
			<td><dfn>http://docs.domain.com/CI_Docs/info/changelog</dfn></td>
			<td><dfn>http://docs.domain.com/CI_Docs/<var>v1.5</var>/info/changelog</dfn></td>
		</tr>
	</tbody>
</table>